package behavior.state;

/**
 * 车辆状态上下文
 */
public class Context {

    public final static VehicleState IN_OUT_STATE = new InOutState();
    public final static VehicleState START_STATE = new StartState();
    public final static VehicleState STOP_STATE = new StopState();
    public final static VehicleState CHARGE_STATE = new ChargeState();
    public final static VehicleState REPAIR_STATE = new RepairState();


    private VehicleState vehicleState;

    public Context(){
        vehicleState = null;
    }

    public VehicleState getVehicleState() {
        return vehicleState;
    }

    public void setVehicleState(VehicleState vehicleState){
        this.vehicleState = vehicleState;
    }

    void inOut(){
        vehicleState.inOut(this);
    }

    void start(){
        vehicleState.start(this);
    }

    void stop(){
        vehicleState.stop(this);
    }

    void charge(){
        vehicleState.charge(this);
    }

    void repair(){
        vehicleState.repair(this);
    }


}
